package longcaisuyun.longcai.com.utils;

import android.os.CountDownTimer;
import android.widget.Button;

/**
 * Created by Administrator on 2016/4/1.
 */
public   class TimeCount extends CountDownTimer {

    /**
     * 构造方法
     *
     * @param millisInFuture
     *            总倒计时长 毫秒
     * @param countDownInterval
     *            倒计时间隔
     */
    Button textView;
    public TimeCount(long millisInFuture, long countDownInterval,final Button textView) {
        super(millisInFuture, countDownInterval);
        this.textView=textView;
    }

    @Override
    public void onTick(long millisUntilFinished) {
        textView.setClickable(false);
        textView.setText(millisUntilFinished / 1000 + "秒");
    }

    @Override
    public void onFinish() {// 计时结束
        textView.setClickable(true);
        textView.setText("重新获取");

    }

}